/***************************************************
 @Name :        小铭同学
 @Time :        2025-09-03
 @Email :       LiaoMingWJ233@163.com
 @Comment :     摄像头打开与关闭
 @FileName :    widget.h
 @Version :     1.0
****************************************************/


#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QScreen>
#include <QCamera>  //导入摄像头类
#include <QCameraInfo>  //摄像头信息类
#include <QCameraViewfinder>  //取景器类
#include <QCameraImageCapture>  //捕获类
#include <QCameraViewfinderSettings>  //摄像头设置类
#include <QTimer>

#include "hal_v4l2api.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT
    
public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

protected:
    void PushButton_Tcp(QPushButton* PushButton);
    
    bool State = false;  // 状态变量
    
private slots:
    
    void Camera_state();
    void on_exit_clicked();
    
    void recvImage(QImage image);
    void myslot();
    
    
private:
    Ui::Widget *ui;
    
    V4l2Api vapi;
    QImage Saveimage;
    int flag;
    
};
#endif // WIDGET_H
